// 所有配置: https://pm2.keymetrics.io/docs/usage/application-declaration/
module.exports = {
  apps : [{
    name: 'slake5-img',
    script: 'lib/index.js',
    autorestart: true,
    env_production: {
      NODE_ENV: 'production'
    }
  }],

  deploy : {
    production : {
      user : 'root',
      host : '188.131.243.4',
      port: '12345',
      ref  : 'origin/master',
      repo : 'https://gitee.com/leleleyu/slake5-img.git',
      path : '/root/web',
      'pre-deploy': 'source ~/.zshrc && yarn && yarn build',
      'post-deploy' : 'source ~/.zshrc && pm2 startOrRestart ecosystem.config.js --env production' // 指定变量为 env_production
    }
  }
};
